<extend name="Base/base" />
<block name='head'>
    <style>
    </style>
</block>
<block name="content"> 
    <section class="larry-wrapper" style="padding-top: 20px">
        <!--<p class="nav-title"><span>缺勤信息</span></p>-->
        <!--第一部分-->
        <div class="row page-inquire">
            <div class="col-lg-12 col-sm-12">	
                <form class="form" method="get" action="{:U('useGoods')}">
                    <div class="layui-row">
                        <div class="layui-inline">
                            <label class="layui-form-label">领用人：</label>
                            <div class="layui-input-inline">
                                <input type="text" placeholder="用户" name="user_id" value="{$userId}" class="layui-input" >
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">时间：</label>
                            <div class="layui-input-inline">
                                <input type="text" placeholder="开始时间" name="start" value='{$start}' class="layui-input datepickerInput">    
                            </div>
                            <div class="layui-input-inline">至</div>
                            <div class="layui-input-inline">
                                <input type="text" placeholder="结束时间" name="end" value='{$end}' class="layui-input datepickerInput">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">类别：</label>
                            <div class="layui-input-inline">
                                <select class="layui-input search_input" name="type" style="min-width: 120px;">
                                    <option value="1" {$type == 1 ? 'selected' : ''}>信息化产品</option>
                                    <option value="2" {$type == 2 ? 'selected' : ''}>低值易耗品</option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">状态：</label>
                            <div class="layui-input-inline">
                                <select class="layui-input search_input" name="status" style="min-width: 120px;">
                                    <option value="-1">全部</option>
                                    <option value="1" {$status == 1 ? 'selected' : ''}>已出库</option>
                                    <option value="0" {$status == 0 ? 'selected' : ''}>未出库</option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">物品名称：</label>
                            <div class="layui-input-inline">
                                <input type="text" placeholder="按物品名称" name="name" value="{$name}" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <a class="layui-btn search_btn search">查询</a>
                        </div>
                    </div>
                </form>
                <div class="layui-row">
                    <table class="layui-table setTabBg" lay-skin="line">
                        <thead>
                            <tr>
                                <th>物品名称</th>
                                <th>型号</th>
                                <th>申请数量</th>
                                <th>领用人</th>
                                <th>领用时间</th>
                                <th>备注信息</th>
                                <th>状态</th>
                                <th>出库数量</th>
                                <th>出库时间</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                        <foreach name='goods' item='row'>
                            <tr>
                                <td>{$row.goods_id|getGoodsName}</td>
                                <td>{$row.goods_id|getGoodsModel}</td>
                                <td><if condition="$row['auditor'] eq null && $row['user_id'] eq $user && $isAdmin eq 0"><input type="text" class="layui-input num" value="{$row.count}" style="width:100px"><else/>{$row.count}</if></td>
                                <td>{$row.user_id|getChineseName}</td>
                                <td>{$row.create_time|date="Y-m-d H:i",###}</td>
                                <td>{$row.remark|default="无"}</td>
                                <td>{$row['status'] ? '<font color="green">已出库</font>' :'<font color="red">未出库</font>' }</td>
                                <td style='color:red'><if condition="$row['auditor'] eq null && $isAdmin eq 1"><input type="text" class="layui-input num" value="{$row.real_count}" style="width:100px"><else/>{$row.real_count}</if></td>
                            <td><if condition="$row['auditor_time'] neq 0">{$row.auditor_time|date="Y-m-d H:i",###}<else/>-</if></td>
                            <td>
                            <if condition="$row[status] eq 0 && $isAdmin eq 1">
                                <a class="pointer confirm" data-url="{:U('confirm')}" data-id="{$row.id}">确认出库</a>
                            </if>
                            <if condition="$row[status] eq 0 && $row['user_id'] eq $user">
                                <a class="pointer confirm" data-url="{:U('confirm',array('type'=>1))}" data-id="{$row.id}">修改</a>
                                <a class="pointer delete" data-url="{:U('delete',array('id'=>$row[id],'type'=>1))}">删除</a>
                            </if>
                            </td>
                            </tr>
                        </foreach>
                        </tbody>
                    </table>
                    <div class="larry-table-page clearfix">
                        <div id="page" class="page">{$page}</div>
                    </div>
                </div>
            </div>
        </div>
    </section>
</block>
<block name="script">
    <script type="text/javascript" src="/Public/Admin/js/goods.js"></script>
    <script type="text/javascript" src="/Public/Admin/js/common.js"></script>
    <script type="text/javascript">
        $(initGoods());
        $(dateTime(0));

    </script>    
</block>

